package com.zhinong.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordUtils {
    private static final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();

    // 加密密码
    public static String encode(String password) {
        return encoder.encode(password);
    }

    // 验证密码
    public static boolean matches(String inputPassword, String encodedPassword) {
        return encoder.matches(inputPassword, encodedPassword);
    }
}